package com.cz.pg;

import cn.hutool.db.Db;
import cn.hutool.db.Entity;
import cn.hutool.db.Page;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Random;

public class GPSelect {
    // Common letters for stock tickers
    public static void main(String[] args) {
        try {
            List<Entity> entities = Db.use("pg").page(new Entity("stocks_real_time"),new Page(1,10));
            entities.forEach(entity -> {
                System.out.println(entity.getStr("time")+" "+entity.getStr("symbol")+" "+entity.getStr("price") +" "+entity.getStr("day_volume"));
            });
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }


}
